package com.hualu.zks.httpclient;

import org.apache.http.HttpResponse;



/**
 * Callback passed to an {@link AsyncRequestExecutor} so that the
 * calling code can be notified when a request is complete or
 * has thrown an exception.
 * 
 */
public abstract class AsyncTaskCallback {

    /**
     * Called when response is available or max retries exhausted. 
     * 
     * @param ret 参数用于判断执行中是否有误
     * @param httpResponse may be null!
     */
    public abstract void onComplete(int ret);
    
//    /**
//     * Called when response is available or max retries exhausted. 
//     * 
//     * @param httpResponse may be null!
//     */
//    public abstract void onComplete(HttpResponse httpResponse);
    
    /**
     * Called when a non-recoverable exception has occurred.
     * Timeout exceptions are considered recoverable and won't
     * trigger this call.
     * 
     * @param e
     */
    public void onError(Exception e) {
        e.printStackTrace();
    }
    
    /**
     * 未登录
     */
    public void onUnauthorized() {
    	
    }

    /**
     * 404
     */
    public void onHttpNotFound() {
    	
    }
    
}
